FIG. 1 illustrates a conventional system for data replication and synchronization. The system of FIG. 1 has three tiers: a source 101, a mirror 102, and a client 103. The client 103 can be a mobile database. The mirror 102 and source 101 are database servers. The mirror 102 stores a subset of the data at the source 101. The client 103 typically stores a subset of the data at the mirror 102. Replication is the transmission of data between the mirror 102 and the source 101 with the purpose of keeping their data in sync. Synchronization is the transmission of data between the client 103 and the mirror 102 to keep their data in sync. Typically, synchronization occurs more often than replication, and there are many more clients than mirrors. The replication and the synchronization attempt to occur simultaneously. “Simultaneous” as used in this specification, refers to instructions within two different threads attempting to be executed concurrently.
One conventional approach for facilitating replication and synchronization is to use a single snapshot of the source 101, shared by both the synchronization and the replication. However, while the data is being written during the replication, any attempts to simultaneously read the data during synchronization are blocked to maintain the integrity of the data retrieved. “Simultaneous” as used in this specification, refers to instructions within two different threads attempting to be executed concurrently. In another conventional approach, a plurality of snapshots is shared while providing isolation levels in the mirror 102. Although this approach allows the simultaneous write (during replication) and read (during synchronization) of the snapshots, simultaneous writes during replication and synchronization are blocked. Thus, the conventional approaches are limited in their efficiency of the replication and synchronization processes.
Accordingly, there exists a need for an improved method and system for synchronization-replication concurrency. The method and system should allow simultaneous reads, writes, and read-writes during replication and synchronization, while maintaining data integrity. The present invention addresses such a need.